import SvgIcon from './SvgIcon/index.vue'
import Pagination from './Pagination/index.vue'
import { App, Component } from 'vue'

interface GlobalComponents {
  [key: string]: Component
}
// 全局对象
const allGlobalComponent: GlobalComponents = { SvgIcon, Pagination }
// 对外暴露一个插件对象
export default {
  install(app: App) {
    Object.keys(allGlobalComponent).forEach((key) => {
      // 注册为全局组件
      app.component(key, allGlobalComponent[key])
    })
  },
}
